﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Tradex.Operations {
    
    /// <summary>
    /// Contains the rarely changing standard entries of the Principal object.
    /// </summary>
    [Serializable ()]
    public sealed class PrincipalInfo {

        /// <summary>
        /// Constructor taking all values.
        /// </summary>
        public PrincipalInfo(
            DateTime timestamp,
            string windowsIdentity,
            string password,
            bool isActive
        ) {
            Timestamp = timestamp;
            WindowsIdentity = windowsIdentity;
            Password = password;
            IsActive = isActive;
        }

        /// <summary>
        /// The Timestamp of the data.
        /// </summary>
        public DateTime Timestamp { get; private set; }

        /// <summary>
        /// The windows identity for integrated security, or null of no windows Identity exists.
        /// </summary>
        public string WindowsIdentity { get; private set; }

        /// <summary>
        /// The Password of the Identity, if Tradex itself can authenticate the Principal. The password is encoded as with SHA1.
        /// </summary>
        public string Password { get; private set; }

        /// <summary>
        /// A bool indicating whether the Principial is active or not. Principals can never be deleted (as they are referenced
        /// from a great many other items) - instead they are deactivated.
        /// </summary>
        public bool IsActive { get; private set; }

    }
}
